<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            height: 300px;
            position: absolute;
            right: 0;
            bottom: 0;
            background: springgreen;
        }
        .close{
            width: 30px;
            height: 30px;
            position: relative;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
    <!-- 实现流氓广告的关闭
    显示一个流氓广告框，点击关闭后 4秒钟后继续显示出来-->
    <div class="box">
        <button class="close">x</button>
    </div>
    <script>
        var box = document.querySelector(".box");
        var btn = document.querySelector(".close");
        btn.onclick = function(){
            box.style.display = "none"
            setTimeout(() => {
                box.style.display = "block"
            }, 4000);
        }
    </script>
</body>

</html>